package app.fugema.shop.main.login.view;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import com.base.common.utils.UIUtils;
import com.base.common.view.base.BaseTitleActivity;
import com.base.common.viewmodel.BaseViewModel;
import app.fugema.shop.R;
import app.fugema.shop.databinding.UserAgreementActivityBinding;

public class UserAgreementActivity extends BaseTitleActivity<UserAgreementActivityBinding, BaseViewModel> {

    public static void lunch(Context context, boolean isAgreement) {
        Intent intent = new Intent(context, UserAgreementActivity.class);
        intent.putExtra("isAgreement", isAgreement);
        context.startActivity(intent);
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.user_agreement_activity);

    }

    @Override
    protected void initData(Intent intent) {
        super.initData(intent);


        boolean isAgreement = intent.getBooleanExtra("isAgreement", false);
        if (isAgreement) {
            setTitle("用户服务协议");
            String agreement = UIUtils.getAssetsText("agreement");
            binding.tvContent.setText(agreement);
        } else {
            setTitle("用户隐私协议");
            String agreement = UIUtils.getAssetsText("privacy");
            binding.tvContent.setText(agreement);
        }


    }
}
